↳ Prolog
↳ PrologToPiTRSProof
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
COUNT_IN(cons(cons(U, V), W), Z) → U41(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
COUNT_IN(cons(cons(U, V), W), Z) → FLATTEN_IN(cons(cons(U, V), W), X)
FLATTEN_IN(cons(cons(U, V), W), X) → U21(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
FLATTEN_IN(cons(cons(U, V), W), X) → FLATTEN_IN(cons(U, cons(V, W)), X)
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → U11(X, U, Y, flatten_in(U, Y))
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → FLATTEN_IN(U, Y)
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U51(U, V, W, Z, count_in(X, Z))
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → COUNT_IN(X, Z)
COUNT_IN(cons(atom(X), Y), s(Z)) → U31(X, Y, Z, count_in(Y, Z))
COUNT_IN(cons(atom(X), Y), s(Z)) → COUNT_IN(Y, Z)
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
COUNT_IN(cons(cons(U, V), W), Z) → U41(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
COUNT_IN(cons(cons(U, V), W), Z) → FLATTEN_IN(cons(cons(U, V), W), X)
FLATTEN_IN(cons(cons(U, V), W), X) → U21(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
FLATTEN_IN(cons(cons(U, V), W), X) → FLATTEN_IN(cons(U, cons(V, W)), X)
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → U11(X, U, Y, flatten_in(U, Y))
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → FLATTEN_IN(U, Y)
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U51(U, V, W, Z, count_in(X, Z))
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → COUNT_IN(X, Z)
COUNT_IN(cons(atom(X), Y), s(Z)) → U31(X, Y, Z, count_in(Y, Z))
COUNT_IN(cons(atom(X), Y), s(Z)) → COUNT_IN(Y, Z)
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → FLATTEN_IN(U, Y)
FLATTEN_IN(cons(cons(U, V), W), X) → FLATTEN_IN(cons(U, cons(V, W)), X)
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
FLATTEN_IN(cons(atom(X), U), .(X, Y)) → FLATTEN_IN(U, Y)
FLATTEN_IN(cons(cons(U, V), W), X) → FLATTEN_IN(cons(U, cons(V, W)), X)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ UsableRulesReductionPairsProof
↳ PiDP
FLATTEN_IN(cons(cons(U, V), W)) → FLATTEN_IN(cons(U, cons(V, W)))
FLATTEN_IN(cons(atom(X), U)) → FLATTEN_IN(U)
No rules are removed from R.
FLATTEN_IN(cons(cons(U, V), W)) → FLATTEN_IN(cons(U, cons(V, W)))
FLATTEN_IN(cons(atom(X), U)) → FLATTEN_IN(U)
POL(FLATTEN_IN(x1)) = 2·x1
POL(atom(x1)) = x1
POL(cons(x1, x2)) = 2 + 2·x1 + x2
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ UsableRulesReductionPairsProof
↳ QDP
↳ PisEmptyProof
↳ PiDP
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
COUNT_IN(cons(atom(X), Y), s(Z)) → COUNT_IN(Y, Z)
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → COUNT_IN(X, Z)
COUNT_IN(cons(cons(U, V), W), Z) → U41(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
count_in(cons(cons(U, V), W), Z) → U4(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
U4(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → U5(U, V, W, Z, count_in(X, Z))
count_in(cons(atom(X), Y), s(Z)) → U3(X, Y, Z, count_in(Y, Z))
count_in(atom(X), s(0)) → count_out(atom(X), s(0))
U3(X, Y, Z, count_out(Y, Z)) → count_out(cons(atom(X), Y), s(Z))
U5(U, V, W, Z, count_out(X, Z)) → count_out(cons(cons(U, V), W), Z)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
COUNT_IN(cons(atom(X), Y), s(Z)) → COUNT_IN(Y, Z)
U41(U, V, W, Z, flatten_out(cons(cons(U, V), W), X)) → COUNT_IN(X, Z)
COUNT_IN(cons(cons(U, V), W), Z) → U41(U, V, W, Z, flatten_in(cons(cons(U, V), W), X))
flatten_in(cons(cons(U, V), W), X) → U2(U, V, W, X, flatten_in(cons(U, cons(V, W)), X))
U2(U, V, W, X, flatten_out(cons(U, cons(V, W)), X)) → flatten_out(cons(cons(U, V), W), X)
flatten_in(cons(atom(X), U), .(X, Y)) → U1(X, U, Y, flatten_in(U, Y))
U1(X, U, Y, flatten_out(U, Y)) → flatten_out(cons(atom(X), U), .(X, Y))
flatten_in(atom(X), .(X, [])) → flatten_out(atom(X), .(X, []))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ UsableRulesReductionPairsProof
COUNT_IN(cons(cons(U, V), W)) → U41(flatten_in(cons(cons(U, V), W)))
COUNT_IN(cons(atom(X), Y)) → COUNT_IN(Y)
U41(flatten_out(X)) → COUNT_IN(X)
flatten_in(cons(cons(U, V), W)) → U2(flatten_in(cons(U, cons(V, W))))
U2(flatten_out(X)) → flatten_out(X)
flatten_in(cons(atom(X), U)) → U1(X, flatten_in(U))
U1(X, flatten_out(Y)) → flatten_out(.(X, Y))
flatten_in(atom(X)) → flatten_out(.(X, []))
flatten_in(x0)
U2(x0)
U1(x0, x1)
The following rules are removed from R:
COUNT_IN(cons(cons(U, V), W)) → U41(flatten_in(cons(cons(U, V), W)))
COUNT_IN(cons(atom(X), Y)) → COUNT_IN(Y)
Used ordering: POLO with Polynomial interpretation [25]:
flatten_in(cons(cons(U, V), W)) → U2(flatten_in(cons(U, cons(V, W))))
flatten_in(cons(atom(X), U)) → U1(X, flatten_in(U))
U2(flatten_out(X)) → flatten_out(X)
flatten_in(atom(X)) → flatten_out(.(X, []))
U1(X, flatten_out(Y)) → flatten_out(.(X, Y))
POL(.(x1, x2)) = x1 + x2
POL(COUNT_IN(x1)) = 2 + x1
POL(U1(x1, x2)) = 1 + 2·x1 + x2
POL(U2(x1)) = 1 + x1
POL(U41(x1)) = 1 + x1
POL([]) = 0
POL(atom(x1)) = 1 + 2·x1
POL(cons(x1, x2)) = 2 + 2·x1 + x2
POL(flatten_in(x1)) = x1
POL(flatten_out(x1)) = 1 + 2·x1
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ UsableRulesReductionPairsProof
↳ QDP
↳ DependencyGraphProof
U41(flatten_out(X)) → COUNT_IN(X)
flatten_in(x0)
U2(x0)
U1(x0, x1)